#ifndef GLOBALS_H
#define GLOBALS_H
//------------------------------------------------------------------------------------------------
//  Author: Kebal
//  Date:   6-6-13
//  Desc:   Global variables to make changes to things like days per week centralized
//------------------------------------------------------------------------------------------------

//--------------------------
//  Includes
//--------------------------
#include <QDate>
#include <QString>
#include <QTime>

//---------------------------
//  enum
//---------------------------
enum    ACTIVITIES
{
    Traveling = 0,
    Dropping,
    Collecting,
    Delivering,
    Other
};

//--------------------------
//  Defines
//--------------------------
#define _DAYSPERWEEK    5               //  how many days do we work per week (default)

QString     g_StreetFilename    = "Streets.data";
QString     g_AddressFilename   = "Address.data";
QString     g_CustomerFilename  = "Customer.data";
QString     g_ProductsFilename  = "Products.data";
QString     g_LineItemsFilename = "LineItems.data";
QString     g_OrdersFilename    = "Orders.data";

QString     g_DataFolder        = "/Data/";

//--------------------------
//  Structures
//--------------------------
struct  SSTREET
{
    QString sStreet;                    //  Street name
    QString sTown;                      //  Town name
    QString sCity;                      //  City name
    QString sCounty;                    //  County/Province name
};
typedef SSTREET*    LPSTREET;


struct  SADDRESS
{
    SSTREET sStreet;                    //  Street data
    union
    {
        int     iHouseNum;              //  House number
        char*   sHouseName;             //  House name
    };

    QString sPostCode;                  //  Post Code

    bool    bWantsCat;                  //  Wants a catalogue?
};
typedef SADDRESS*   LPADDRESS;


struct  SCUSTOMER
{
    int         iCustomerID;            //  Customer ID

    SADDRESS    sAddress;               //  Customer Address

    QString     sFirstName;             //  First name
    QString     sLastName;              //  Last name

    QString     sTelephoneNum;          //  Main telephone number
    QString     sTelephoneNum2;         //  Secondary telephone number

    QString     sEmail1;                //  Main email
    QString     sEmail2;                //  Secondary email

    QString     sNotes;                 //  Additional notes
};
typedef SCUSTOMER*  LPCUSTOMER;


struct  SPRODUCT
{
    QString     sProductCode;           //  Product Code
    QString     sProductDescription;    //  Product Description
    double      fPrice;                 //  Product Price
};
typedef SPRODUCT*   LPPRODUCT;


struct  SLINEITEM
{
    int         iLineItemID;            //  LineItem ID

    LPPRODUCT   pProduct;               //  Product pointer
    int         iQuantity;              //  Quantity
};
typedef SLINEITEM*  LPLINEITEM;


struct  SORDER
{
    int         iOrderID;               //  Order ID

    int         iNumLineItems;          //  number of line items in array
    int*        pLineItems;             //  array of line items

    int         iCustomerID;            //  Customer ID
    QDate       dDate;                  //  Date of order
};
typedef SORDER* LPORDER;


#endif // GLOBALS_H
